package com.liuyjy2.controller;

import com.liuyjy2.encryptDecrypt.EncryptDecrypt;
import com.liuyjy2.entity.UserBO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/encrypt")
@Slf4j
public class EncryptController {

    @PostMapping("/v1")
    @EncryptDecrypt
    public UserBO insert(@RequestBody UserBO user) {
        log.info("加密后对象：{}", user);
        return user;
    }

    @PostMapping("/v2")
    @EncryptDecrypt
    public String insert(String str, String str2) {
        log.info("加密后对象：{}", str);
        return str;
    }

    @PostMapping("/v3")
    @EncryptDecrypt
    public List<String> insert(@RequestBody List<String> str) {
        log.info("加密后对象：{}", str);
        return str;
    }
}
